﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace KaiXin001er.Objects
{
    [Serializable]
    public class Account
    {
        # region 帐户图片
        /// <summary>
        /// 帐户的签名图片
        /// </summary>
        private Image _AcctImage;
        /// <summary>
        /// 帐户的签名图片
        /// </summary>
        public Image AcctImage
        {
            get { return _AcctImage; }
            set { _AcctImage = value; this._AcctImageLoaded = true; }
        }
        /// <summary>
        /// 帐户图片是否读取了 初始时候是没有读取的
        /// </summary>
        private bool _AcctImageLoaded = false;
        /// <summary>
        /// 帐户图片是否读取了 初始时候是没有读取的
        /// </summary>
        public bool AcctImageLoaded
        {
            get { return _AcctImageLoaded; }
            //set { _AcctImageLoaded = value; }
        }
        #endregion
        #region 帐户组件
        /// <summary>
        /// 帐户组件
        /// </summary>
        private List<string> _Components = new List<string>();
        /// <summary>
        /// 帐户组件
        /// </summary>
        public List<string> Components
        {
            get { if (_Components == null)_Components = new List<string>(); return _Components; }
            set { _Components = value; }
        }
        #endregion
        #region 帐户的好友
        /// <summary>
        /// 是否需要初始化
        /// 如果需要控制程序去读取自己的id和好友ID
        /// </summary>
        private bool _FriendLoaded = false;
        /// <summary>
        /// 是否需要初始化
        /// 如果需要控制程序去读取自己的id和好友ID
        /// </summary>
        public bool FriendsLoaded
        {
            get { return _FriendLoaded; }
            set { _FriendLoaded = value; }
        }
        /// <summary>
        /// 好友列表
        /// </summary>
        private List<Friend> _Friends= new List<Friend>();
        /// <summary>
        /// 好友列表
        /// </summary>
        public List<Friend> Friends
        {
            get
            {
                if (_Friends == null) _Friends = new List<Friend>();
                return _Friends; 
            }
            set {  _Friends = value; }
        }
        #endregion
        public bool HasFriend(string id)
        {
            foreach (Friend friend in Friends)
            {
                if (friend.FriendID == id) return true;
            }
            return false;
        }
        /// <summary>
        /// 根据好友ID查找好友
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Friend FindFriendByID(string id)
        {
            foreach (Friend friend in Friends)
            {
                if (friend.FriendID == id)  return friend;
            }
            return new Friend("0", "未知好友[需要重新读取好友]");
        }
        /// <summary>
        /// 帐户的ID
        /// </summary>
        private string _playerID;
        /// <summary>
        /// 这是登陆时期填写的 帐户的ID
        /// </summary>
        public string PlayerID
        {
            get { return _playerID; }
            set { _playerID = value; }
        }
        private string _verifyCode;
        /// <summary>
        /// 这是登陆时期填写的
        /// </summary>
        public string VerifyCode
        {
            get { return _verifyCode; }
            set { _verifyCode = value; }
        }
        /// <summary>
        /// 帐户名称 创建的时候填写
        /// </summary>
        private string _AcctName;
        /// <summary>
        /// 帐户名称
        /// </summary>
        public string AcctName
        {
            get { return _AcctName; }
            set { _AcctName = value; }
        }
        /// <summary>
        /// 帐户的邮件 账号
        /// </summary>
        private string _AcctEmail;
        /// <summary>
        /// 帐户Email
        /// </summary>
        public string AcctEmail
        {
            get { return _AcctEmail; }
            set { _AcctEmail = value; }
        }
        /// <summary>
        /// 帐户的密码
        /// </summary>
        private string _AcctPassword;
        /// <summary>
        /// 帐户密码
        /// </summary>
        public string AcctPassword
        {
            get { return _AcctPassword; }
            set { _AcctPassword = value; }
        }

        /// <summary>
        /// 是否打工
        /// </summary>
        private bool _isDoJob = true;

        public bool IsDoJob
        {
            get { return _isDoJob; }
            set { _isDoJob = value; }
        }

        /// <summary>
        /// 帮助好友生产？
        /// </summary>
        private bool _isHelpProd = true;

        public bool IsHelpProd
        {
            get { return _isHelpProd; }
            set { _isHelpProd = value; }
        }
        /// <summary>
        /// 是否偷牧场产品？
        /// </summary>
        private bool _isRancherSteal = true;

        public bool IsRancherSteal
        {
            get { return _isRancherSteal; }
            set { _isRancherSteal = value; }
        }
        /// <summary>
        /// 是否牧场填水
        /// </summary>
        private bool _isRancherWater = true;

        public bool IsRancherWater
        {
            get { return _isRancherWater; }
            set { _isRancherWater = value; }
        }

        /// <summary>
        /// 是否搞牧场功能
        /// </summary>
        private bool _isRancher = true;

        public bool IsRancher
        {
            get { return _isRancher; }
            set { _isRancher = value; }
        }

        /// <summary>
        /// 是否菜地偷盗
        /// </summary>
        private bool _isGardenSteal = true;

        public bool IsGardenSteal
        {
            get { return _isGardenSteal; }
            set { _isGardenSteal = value; }
        }
        
        /// <summary>
        /// 菜地浇水？
        /// </summary>
        private bool _isGardenWater = true;

        public bool IsGardenWater
        {
            get { return _isGardenWater; }
            set { _isGardenWater = value; }
        }
        /// <summary>
        /// 是否捉虫
        /// </summary>
        private bool _isAntivirmin = true;

        public bool IsAntivirmin
        {
            get { return _isAntivirmin; }
            set { _isAntivirmin = value; }
        }
        /// <summary>
        /// 是否除草
        /// </summary>
        private bool _isAntiGrass = true;

        public bool IsAntiGrass
        {
            get { return _isAntiGrass; }
            set { _isAntiGrass = value; }
        }
        /// <summary>
        /// 是否搞花园菜地的功能
        /// </summary>
        private bool _isGarden = true;

        public bool IsGarden
        {
            get { return _isGarden; }
            set { _isGarden = value; }
        }
        
        /// <summary>
        /// 是否拉力赛
        /// </summary>
        private bool _isRace = true;

        public bool IsRace
        {
            get { return _isRace; }
            set { _isRace = value; }
        }
        
        /// <summary>
        /// 是否挪车
        /// </summary>
        private bool _isPark = true;

        public bool IsPark
        {
            get { return _isPark; }
            set { _isPark = value; }
        }
        
        /// <summary>
        /// 是否停车
        /// </summary>
        private bool _IsParkGame=true;
        /// <summary>
        /// 是否停车
        /// </summary>
        public bool IsParkGame
        {
            get { return _IsParkGame; }
            set { _IsParkGame = value; }
        }
        /// <summary>
        /// 是否花园房子
        /// </summary>
        private bool _IsHouseGame=true;
        /// <summary>
        /// 是否花园游戏
        /// </summary>
        public bool IsHouseGame
        {
            get { return _IsHouseGame; }
            set { _IsHouseGame = value; }
        }
        /// <summary>
        /// 启动顺序
        /// </summary>
        private decimal _StartSeq=0;
        /// <summary>
        /// 在所有帐户中的启动顺序
        /// </summary>
        public decimal StartSeq
        {
            get { return _StartSeq; }
            set { _StartSeq = value; }
        }
        /// <summary>
        /// 是否启用该帐户 总开关
        /// </summary>
        private bool _Enable=true;
        /// <summary>
        /// 是否启用该帐户 总开关
        /// </summary>
        public bool Enable
        {
            get { return _Enable; }
            set { _Enable = value; }
        }


    }
}
